import {Newsongexpress,XindieshangjiaList,AllnewdiscsList} from '@/api/api'
const state={
//新歌速递
datalist:[],
//新碟上架
monthData:[]
};
const mutations={
//新歌速递
NEWSONGEXPESS(state,datalist){
  state.datalist = datalist
},
//新碟上架
XINDIESHANGJIA(state,monthData){
  state.monthData = monthData
},
  //全部新碟
  ALLNEWDISCSLIST(state,monthData){
    state.monthData = monthData
  }
};
const actions={
//新歌速递
 async getNewsongexpress({commit},{type}){
  let request = await Newsongexpress(type)
  if(request.data.code==200){
    commit('NEWSONGEXPESS',request.data.data)
  }
  },
  //新碟上架
 async getXindieshangjiaList({commit},{area}){
   let request = await XindieshangjiaList(area)
   if(request.data.code==200){
    commit('XINDIESHANGJIA',request.data.monthData)
   }
  },
  //全部新碟
 async getAllnewdiscsList({commit},{limit,area}){
  let request = await AllnewdiscsList({limit,area})
  if(request.data.code==200){
    commit('ALLNEWDISCSLIST',request.data.albums)
  }
  }
};
const getters={

};
export default {
  state,
  mutations,
  actions,
  getters
}